package club.janna.jrpc.remoting.netty;

import club.janna.jrpc.remoting.Channel;

/**
 * @author Panbo.Guo
 */
public class NettyChannel implements Channel {

    private io.netty.channel.Channel channel;

    public NettyChannel(io.netty.channel.Channel channel) {
        this.channel = channel;
    }

    @Override
    public void send(Object obj) {
        channel.writeAndFlush(obj);
    }

    @Override
    public void close() {
        channel.close();
    }
}
